package test;

import java.io.File;

public class DelDir {
	public static void main(String[] args) {
		String pathname = "E:/test";
		File file = new File(pathname);
		delDir(file);
	}
	
	public static void delDir(File file){
		if(file.isFile()){
			file.delete();
		}else{
			File[] files = file.listFiles();
			for(File f:files)
				delDir(f);
		}
		file.delete();
	}
}
